<?php
class ScheduleModel extends CI_Model{

    public function __construct(){
        $this->load->database();
        parent:: __construct();
    }

    //only show  recently schedule
    public function getList($time){
        $data = array(
            'startTime >'=> $time
        );
        $query = $this->db->get_where("schedulelist", $data);
        return  $query->result_array();
        
    }


    public function add($startPoint, $endPoint, $startTime, $desLocX, $desLocY){
        $data = array(
            'startPoint'=>$startPoint, 
            'endPoint'=>$endPoint, 
            'startTime'=>$startTime, 
            'destinationLocationX'=>$desLocX, 
            'destinationLocationY'=>$desLocY
        );
        $this->db->insert('schedulelist', $data); 
        return $this->db->affected_rows();

    }


}
